| Conditions | 1 |
| Paths | 1 |
| Total Lines | 36 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | var chai = require('chai'); |
||
| 11 | describe('fileAttr', function() { |
||
| 12 | before( function(done) { |
||
| 13 | Manager.instance.init() |
||
| 14 | .then(function () { |
||
| 15 | Manager.instance._whereKeys = ['title', 'priority', 'abe_meta', 'articles'] |
||
| 16 | Manager.instance.updateList() |
||
| 17 | |||
| 18 | this.fixture = { |
||
| 19 | jsonDraft: fse.readJsonSync(__dirname + '/fixtures/data/article-1-abe-d20160919T125255138Z.json') |
||
|
|
|||
| 20 | } |
||
| 21 | done() |
||
| 22 | |||
| 23 | }.bind(this)) |
||
| 24 | }); |
||
| 25 | |||
| 26 | /** |
||
| 27 | * cmsData.fileAttr.test |
||
| 28 | * |
||
| 29 | */ |
||
| 30 | it('cmsData.fileAttr.test()', function() { |
||
| 31 | var bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.latest.abeUrl) |
||
| 32 | chai.expect(bool).to.be.true; |
||
| 33 | bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.link) |
||
| 34 | chai.expect(bool).to.be.false; |
||
| 35 | }); |
||
| 36 | |||
| 37 | /** |
||
| 38 | * cmsData.fileAttr.delete |
||
| 39 | * |
||
| 40 | */ |
||
| 41 | it('cmsData.fileAttr.delete()', function() { |
||
| 42 | var str = cmsData.fileAttr.delete(this.fixture.jsonDraft.abe_meta.latest.abeUrl) |
||
| 43 | var bool = cmsData.fileAttr.test(str) |
||
| 44 | chai.expect(bool).to.be.false; |
||
| 45 | }); |
||
| 46 | }); |
||
| 47 |